<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/header :: header}">
</head>
<body>

<!-- Page Content -->
<div class="container blog-content-container">

    <div class="row">

        <!-- Blog Entries Column -->
        <div class="col-md-8">

            <!-- Blog Post -->
            <div class="card mb-4">
                <div class="card-block" th:object="${blogModel.blog}">
                    <input type="hidden" name="id" th:value="*{id}" id="blogId">
                    <input  type="text" class="form-control" placeholder="请填写博客标题"  id="title" name="title"  th:value="*{title}"  maxlength="50">

                    <textarea class="blog-textarea" placeholder="请填写博客摘要"  id="summary" name="summary"  th:text="*{summary}" maxlength="300"></textarea>

                    <hr>

                    <div class="editormd" id="test-editormd">
                        <textarea class="editormd-markdown-textarea" name="test-editormd-markdown-doc" id="content"
                                  th:text="*{content}"></textarea>
                        <!-- 第二个隐藏文本域，用来构造生成的HTML代码，方便表单POST提交，这里的name可以任意取，后台接受时以这个name键为准 -->
                        <textarea class="editormd-html-textarea" name="editormd-html-textarea" id="htmlContent"
                                  th:text="*{htmlContent}"></textarea>
                    </div>

                    <hr>
                </div>

            </div>

        </div>

        <!-- 右侧栏目 -->
        <div class="col-md-4">

            <div class="card ">
                <h5 class="card-header"><i class="fa fa-cog" aria-hidden="true"></i> 博客设置</h5>
                <div class="card-block">
                    <div class="row mt-1">
                        <div  class="col-lg-12">
                            标签： 					<input type="text" class="form-control form-control-tag" th:value="${blogModel.blog.tags}">
                        </div>
                    </div>
                    <div class="row mt-1">
                        <div  class="col-lg-12">
                            分类：					<select id="catalogSelect" class="form-control form-control-chosen" data-placeholder="请选择" >
                            <option th:value="*{id}" th:text="*{name}" th:each="catalog : ${blogModel.catalogs}" th:object="${catalog}" th:selected="${catalog  eq blogModel.blog.catalog }">Java</option>
                        </select>
                        </div>
                    </div>
                    <div class="row mt-1">
                        <div  class="col-lg-12">
                            <button class="btn btn-primary float-right" id="submitBlog"  th:attr="userName=${#authentication.name}">发布</button>
                        </div>
                    </div>

                </div>

            </div>
        </div>

    </div>
    <!-- /.row -->

</div>
<!-- /.container -->


<div th:replace="~{fragments/footer :: footer}">...</div>

<script th:src="@{/js/userspace/blogeditor.js}"></script>

</body>
</html>